<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="/template.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:define name="title">
        <h:outputText value="Annotation Edition"></h:outputText>
    </ui:define>
    <ui:define name="body">
        <h:form styleClass="form" >
            <p:fieldset legend="Annotation Edit" >
                <h:outputText value="#{genBankController.current_fk.value}" styleClass="engraved"/>
                <br/>
                <p:separator/>
                <p:commandButton id="save" actionListener="#{genBankController.update()}" value="Save" process="@form" update="@form">
                </p:commandButton>
                <p:spacer width="10"/>
                <p:commandButton id="canc" actionListener="#{genBankController.cancelEditing()}" value="Undo Changes" process="@form" update="@form">
                </p:commandButton>
                 <p:spacer width="10"/>
                <p:commandButton id="back" action="/genBank/View" value="Back to List" process="@form" update="@form">
                </p:commandButton>
                <br/>
                <br />
                <p:panel id="panel" style="background-color:##{genBankController.current_fk.statusStsId.stsColor}" >
                    <p:selectOneMenu id="color" value="#{genBankController.current_fk.statusStsId}" >
                        <f:selectItems itemLabel="#{s.stsStatus}" itemValue="#{s}" value="#{statusController.items}" var="s" transient="true"  />
                        <f:ajax event="change" execute="@this" render="panel"/>
                    </p:selectOneMenu>
                </p:panel>
                <br/>
                <h:outputText value="#{genBankController.current_fk.name}:"  styleClass="label"/>
                <p:inputText value="#{genBankController.current_fk.value}" disabled="true" />
                <p:separator/>
                <p:dataList var="qual"  value="#{genBankController.current_fk.qualifierList}" itemType="none" styleClass="annotation">
                    <p:column>
                        <h:outputText value="#{qual.name}="  styleClass="label"/>
                        <p:inplace  editor="true" >
                            <p:inputText  value="#{qual.value}" required="true" />
                        </p:inplace>
                    </p:column>
                </p:dataList>
                <p:separator/>
                <h:panelGrid columns="3">
                    <p:autoComplete value="#{genBankController.qual.name}" id="basicPojo" completeMethod="#{genBankParser.completeQualifiers}"
                                    var="p" itemLabel="#{p}" itemValue="#{p}" forceSelection="true" queryDelay="50" scrollHeight="200" minQueryLength="1"/>
                    <p:inputText  value="#{genBankController.qual.value}"  />
                    <p:commandButton actionListener="#{genBankController.addQualifier()}"  value="Add Annotation" process="@form" update="@form" />
                </h:panelGrid>
                <p:separator/>

                <p:blockUI block="panel" trigger="save">
                    <h:outputText value="Please wait, data is being processed..." />  <br/>
                    <p:graphicImage value="/resources/ajaxloader.gif"/>
                </p:blockUI>
                 <br/>
                <br/>
                
            </p:fieldset>
        </h:form>
        <h:form>
            <p:fieldset legend="Comments" styleClass="form">
                <p:editor width="800"/>

            </p:fieldset>
        </h:form>
    </ui:define>

</ui:composition>
